//package com.xuzm.sping.spark.demo.config;
//
//import org.apache.spark.api.java.function.Function;
//import org.apache.spark.sql.DataFrame;
//import org.apache.spark.sql.Row;
//import org.apache.spark.sql.hive.HiveContext;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.stereotype.Component;
//
//import java.util.List;
//
//@Component
//public class StartApplication implements ApplicationRunner {
//    @Autowired
//    private HiveContext hc;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        DataFrame df = hc.sql("select count(1) from LCS_DB.STAFF_INFO");
//        List<Long> result = df.javaRDD().map((Function<Row, Long>) row -> {
//            return row.getLong(0);
//        }).collect();
//        result.forEach(System.out::println);
//    }
//}
